<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>  </title>
</head>
<body>
    
</body>
<script>
    var names = ["张三", "李四", "王五"];
    names.push("麻子");  /*增加元素*/
    console.log(names);

    names.splice(2, 2);
    console.log(names)



</script>
</html>